<div id="result">
<!-- search-form -->
<div class="search-form" >
    
    <?php
    $uniqId = uniqid();
    $this->renderPartial('_searchArticle', array(
        'model' => $model,
	'uniqId'=> $uniqId,
    ));
    ?>
</div>

<!-- grid -->
<?php
$this->widget('GridView', array(
    'id' => 'DataGridPopup'.$uniqId,    
    'dataProvider' => $model->search(),
    'afterAjaxUpdate' => 'js:function(id, data) {
                var obj = jQuery.parseJSON(data);
                $("#update-dialog").children().html(obj.content);
                return false;
        }',
    'summaryText' => LGHelpers::getSummary('DataGridPopup'.$uniqId),
    'ajaxUpdate' => 'DataGridPopup'.$uniqId,
    'columns' => array(
        array(
            'header' => t('LBL_TITLE', 'article'),
            'name' => 'title',
            'value' => 'CHtml::link(CHtml::encode($data->title), "javascript:selectArticle($data->id);", array("id" => $data->id))',            
            'type' => 'raw',
            'sortable' => TRUE,
        ),
        array(
	     'header' => t('LBL_UPDATED_BY', 'article'),
            'name' => 'updated_by',
            'htmlOptions' => array('align' => 'center', 'width' => '100px'),
        ),
        array(
	    'header' => t('LBL_UPDATE_DATE', 'article'),
            'name' => 'update_date',
            'htmlOptions' => array('align' => 'center', 'width' => '150px'),
            'sortable' => TRUE,
        ),
        array(
            'name' => 'id',
            'htmlOptions' => array('align' => 'center', 'width' => '50px'),
        ),
    ),
));
?>
</div>
<script type="text/javascript">    
    function selectArticle (id){
        $("#update-dialog").dialog('close');
        setRequiredId(id);
	//Update value of text box 'menu-article'  
        $('#menu-article').val($("#" + id).text());
    }
</script>